﻿using Microsoft.EntityFrameworkCore;
using NewFormatProject.Infrastructure.Atrributes;
using NewFormatProject.Infrastructure.EFCore;
using NewFormatProject.Server.EFCore;
using NewFormatProject.Server.Interfaces;
using System.Threading.Tasks;

namespace NewFormatProject.Server.Instances
{
    internal class ErrorIOC
    {
       public SysErrorLogServerEF errorLogServerEF;
    }
    [InjectClass]
    public class ErrorLogServer : IErrorLogServer
    {
        private readonly ErrorIOC _errorIOC;
       public ErrorLogServer(DbContext dbContext)
        {
            _errorIOC=new ErrorIOC
            {
                errorLogServerEF=new SysErrorLogServerEF(dbContext)
            };
        }
        public Task<int> Add(SysErrorLogs errorLog)
        {
           return _errorIOC.errorLogServerEF.Add(errorLog);
        }
    }
}
